<style type="text/css">
body{background:#eee}
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:3.6rem}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
.yuyue-duan {border: 1px solid #19b955;border-radius: 4px;padding:0.1rem;height:auto;width:90px;font-size:0.65rem;text-align:center}
.yuyue-duan span {width:100%;text-align:center}
.timeischack{background:#19b955;color:#fff}
.clear{clear:both;}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'main'">
	<div class="fui-content">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div class="carousel-inner" role="listbox" style="height:6rem">
		<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.banner">
			<a href="#">
				<img src="{{tomedia(item.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
			</a>
		</div>
		</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="item in pagedata.banner" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<div class="fui-line" style="width:6rem;margin:0 auto">
			<div class="text text-danger bold" style="font-size:0.8rem">{{pagedata.diy.worker || '技师'}}列表</div>
		</div>
		<div style="padding:0 0.5rem">
		<div class="fui-list-group merchgroup" ng-repeat="item in pagedata.worker_list">
            <div class="fui-list">
                <a class="fui-list-media storelogo" href="javascript:;" ng-click="access_json('jy_yuyue/worker/detail/id='+item.id)">
                    <img class="round" ng-src="{{tomedia(item.headimg) || '../core/resource/images/nopic.jpg'}}">
                </a>
                <a class="fui-list-inner" style="margin-top:0.16rem" href="javascript:;" ng-click="access_json('jy_yuyue/worker/detail/id='+item.id)">
                    <div class="title" style="font-size:0.76rem">{{item.name}}</div>
                    <div class="store-star">
						<span class="star-on"> <img src="../core/resource/images/star-off.png"></span>
						<span class="star-off" style="width: 88%;"> <img src="../core/resource/images/star-on.png"></span>
						<span class="star-rate">4.5</span>
						<span>已有{{item.num}}个客户预约过</span>
					</div>
					<div class="subtitle" style="font-size:0.55rem">
						<div class="store-moneylimit">
						  <span>{{item.lev_name||'高级技师'}}</span>
						  <span class="store-distance"> 从事行业年限：约{{item.years}}年</span>
						</div>
						<div>
						{{item.remark}}
						</div>
					</div>
                </a>
            </div>
		</div>
		</div>
		<div ng-show="loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
	</div>
</div>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'detail'">
<div class="fui-content">
			<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div class="carousel-inner" role="listbox" style="height:6rem">
		<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.banner">
			<a href="#">
				<img src="{{tomedia(item.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
			</a>
		</div>
		</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="item in pagedata.banner" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<div class="fui-line" style="width:6rem;margin:0.5rem auto 0 auto">
			<div class="text text-danger">{{pagedata.worker.name}}</div>
		</div>
		<div class="weui_cells_title">预约项目</div>
		<div class="weui_cells weui_cells_radio2">
				<label class="weui_cell weui_check_label dashed" ng-repeat="item in pagedata.service">
					<div class="weui_cell_bd" style="padding:0">
						<img style="width:2rem;height:2rem;margin-right:5px;display:block" ng-src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"/>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<span style="float:left;width:100%" ng-model="pagedata.item.title">{{item.title}}</span>
						<span style="float:left;color:red;">价格：{{item.price}}</span>
					</div>
					<div class="weui_cell_ft" href="javascript:;" ng-click="pagedata.getdays(item.id);pagedata.post.serve_id=item.id;" onclick="$('#selecttaocan').modal();">
						<input type="radio" class="weui_check" name="radio1">
						<span class="weui_icon_checked"></span>
					</div>
				</label>
		</div>
		<div ng-if="pagedata.data" class="weui_cells_title">在职日期</div>
		 <div ng-if="pagedata.data" class="fui-tab-scroll weui_cells_radio3 " style="height: 3.2rem;overflow-y:hidden">
			<div ng-if="item.isshow==1" ng-repeat="item in pagedata.data" class="fui-icon-col">
			    <label class="jyui_cell_col">
					<div ng-class="{'coltime':1,'colchecked':pagedata.post.dayid==$index}" ng-click="pagedata.gettimes(pagedata.post.serve_id,$index);pagedata.post.dayid=$index;">
						<div class="timetitle"><span>{{item.riqi}}</span></div>
						<div class="timetitle"><span>{{item.xinq}}</span></div>
					</div>
				</label>
			</div>
		</div>
		<div class="weui_cells_title" ng-if="pagedata.serve_time">请选择活动周期</div>
		<div class="weui_cells" ng-if="pagedata.serve_time">
			<div ng-repeat="row in pagedata.serve_time" ng-if="row.yuyue > 0 && row.show == 1" class="jy-3">
				<div ng-class="{'yuyue-duan':1,'timeischack':pagedata.post.timeid == $index}" ng-click="pagedata.post.timeid=$index;pagedata.canbuy=true">
					<div>{{row.times.start}}~{{row.times.end}}</div>
					<div>(剩余{{row.yuyue}}位)</div>
					<div class="clear"></div>
				</div>
			</div>
			<div ng-repeat="row in pagedata.serve_time" ng-if="row.yuyue == 0 ||  row.show == 0" class="jy-3 disabled">
				<div class="yuyue-duan">
					<div>{{row.times.start}}~{{row.times.end}}</div>
					<div>({{row.show==0?'休息':'约满'}})</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<div class="weui_btn_area">
			 <a ng-if="pagedata.canbuy" class="weui_btn weui_btn_primary" href="javascript:"  ng-click="pagedata.check_buy()">立即预约</a>
			<a ng-if="!pagedata.canbuy" class="weui_btn weui_btn_primary disabled" href="javascript:">立即预约</a>
		</div>
</div>
<div id="selecttaocan" class="modal fade">
					<div class="modal-dialog" style="width:90%;bottom:40%;left:5%;">
						<div class="modal-content" style="border-radius: 4px;padding-bottom:0.5rem">
								<div aria-hidden="true" data-dismiss="modal" class="closebtn"><i class="icon jinyunicon icon-close"></i></div>
								<div class="fui-line" style="width:6rem;margin:0.5rem auto 0 auto">
									<div class="text text-danger" style="background-color:#fff" >选择套餐</div>
								</div>
								<div class="row margin0" style="padding:0.3rem">
									<div class="l-f" ng-repeat="row in pagedata.package" aria-hidden="true" data-dismiss="modal">
											<div ng-class="{'yuyue-duan':1,'timeischack':pagedata.post.packageid == $index}" ng-click="pagedata.post.packageid=$index;">
												<div>{{row.package_title}}--￥{{row.package_price}}</div>
												<div class="clear"></div>
											</div>
									</div>
								</div>
								<div class="clear"></div>
						</div>
					</div>
</div>
</div>
<script type="text/javascript">
scope.pagedata.check_buy=function(){
	var serve_id=scope.pagedata.post.serve_id
	var worker_id=scope.pagedata.post.worker_id
	if(!worker_id && scope.pagedata.worker_list.length>0){
		scope.pagedata.diy.worker=scope.pagedata.diy.worker?scope.pagedata.diy.worker:'技师';
		scope.message('请选择'+scope.pagedata.diy.worker+'！');
		return false;
	}
	if(scope.pagedata.post.timeid=='no'){
		scope.message('请选择时间！');
	}
	var packageid=scope.pagedata.post.packageid
	var timeid=scope.pagedata.post.timeid
	var dayid=scope.pagedata.post.dayid
	scope.get('jy_yuyue/sever/check_buy/serve_id='+serve_id+'&worker_id='+worker_id+'&packageid='+packageid+'&timeid='+timeid+'&dayid='+dayid,function(res){});
}
</script>
<script type="text/javascript">
if(scope.pagedata.basic.dingwei!=1 && !scope.main.lat_lng){
window.scope.location(function(re){
	scope.pagedata.post.address = res.address;
	scope.main.lat_lng=res.lat_lng;
	scope.$evalAsync();
});
}else{
}
</script>
<script type="text/javascript">
scope.pagedata.post.dayid = 0;
scope.pagedata.post.packageid = 0;
scope.pagedata.getdays = function(id){
		scope.get('jy_yuyue/sever/days/id='+id,function(data){
			scope.pagedata.data = data.data;	
		});
		scope.get('jy_yuyue/sever/package/id='+id,function(data){
			scope.pagedata.package = data.package;
			scope.pagedata.post.fileds = data.post.fileds;
		});
		scope.pagedata.gettimes(id,scope.pagedata.post.dayid);
}
scope.pagedata.gettimes = function(id,dayid){
		scope.pagedata.canbuy=false;
		scope.pagedata.post.timeid='no';
		scope.get('jy_yuyue/sever/serve_time/id='+id+'&day='+dayid,function(data){
			scope.pagedata.serve_time = data.serve_time;
				
		});
}
</script>
<div ng-include="sys_html('_footer')"></div>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>